// 封装频道相关操作
import ajax from '../utils/request.js'
/**
 * 获取用户频道
 */
export const getChannel = () => {
  return ajax({
    url: '/app/v1_0/user/channels',
    method: 'GET'
  })
}
/**
 * 获取全部频道
 */
export const getAllChannel = () => {
  return ajax({
    url: '/app/v1_0/channels',
    method: 'GET'
  })
}
/**
 *重置用户关注频道（添加频道）
 * @param {*} channels 添加完毕后的用户关注频道数据
 */
export const changeChannel = (channels) => {
  return ajax({
    url: '/app/v1_0/user/channels',
    method: 'PUT',
    data: {
      channels
    }
  })
}

export const delChannel = (channelId) => {
  return ajax({
    url: '/app/v1_0/user/channels/' + channelId,
    method: 'DELETE'
  })
}
